public class Zuoye3{

	public static void main(String[] args){
	int a = 0;
	for(int i = 0;i <= 1000;i++){
	
		if(i % 7 == 0){
			continue;
		}else{
		
			a = a + i;
		}
	
	}
		System.out.println(a);
	}

}